﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ABDLight
{
    public partial class frmSaveDialog : Form
    {
        public frmSaveDialog()
        {
            InitializeComponent();
        }

        private void frmSaveDialog_Load(object sender, EventArgs e)
        {
            string TabName = ABDLight.Properties.Settings.Default.CleanFileName;
            tFileName.Text = SQLiteData.GetFileName(TabName);
            tFileName.Focus();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            string TabName = ABDLight.Properties.Settings.Default.CleanFileName;
            if (tFileName.Text == "")
                tFileName.Text = SQLiteData.GetFileName(TabName);
            SQLiteData.SetFileName(TabName, tFileName.Text);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            tFileName.Focus();
        }
    }
}
